"""
 输入一个字符串，返回满足以下条件字符串
 ■ 找到字符串中的子串 'not' 和 'bad’
 ■ 如果 'bad' 出现在 'not' 后面，就把 'not' ... 'bad' 之间包含的所有字符串替换成 'good'
"""

s = input()
if (('not' in s) & ('bad' in s)):
    notIndex = s.index('not')
    badIndex = s.index('bad')
    if (notIndex < badIndex):
        print(s[notIndex+3:badIndex])
        s = s.replace(s[notIndex+3:badIndex], 'good')
        print(s)

#测试下来没有问题
#s[0:7] 的用法，要再仔细看看
#答案
"""
   "source": [
    "s=input('input a string:')\n",
    "if ('not' in s) & ('bad' in s):\n",
    "    if (s.index('not') < s.index('bad')):\n",
    "        sc=s.replace(s[(s.index('not')+3):(s.index('bad'))],'good')\n",
    "        print(sc)\n",
    "    else:\n",
    "        print('not isn\\'t before bad')\n",
    "else:\n",
    "    print('not and bad didn\\'t exist at the same time!')"
   ]
"""